package com.nuoniu.sibanyun.mapper.erp;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.erp.ErpCurrency;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  币种设置Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-10-12
 */
public interface ErpCurrencyMapper extends BaseMapper<ErpCurrency> {

    @Select("select * from fab_currency where company_id=#{companyId} and name=#{name}")
    ErpCurrency getByName(Integer companyId, String name);

    @Select("select * from fab_currency where company_id=#{companyId} and name=#{code}")
    ErpCurrency getByCode(Integer companyId, String code);

    @Select("select * from fab_currency where company_id=#{companyId} and is_base_currency=1 limit 1")
    ErpCurrency getByIsBase(Integer companyId);
}
